In order to solve the high time complexity problem of the adversarial example detection algorithm based on Local Intrinsic Dimensionality (LID), combined with the advantages of quantum computing, an adversarial example detection algorithm based on quantum LID was proposed. First, the SWAP-Test quantum algorithm was used to calculate the similarity between the measured example and all examples in one time, avoiding the redundant calculation in the classical algorithm. Then Quantum Phase Estimation (QPE) algorithm and quantum Grover search algorithm were combined to calculate the local intrinsic dimension of the measured example. Finally, LID was used as the evaluation basis of the binary detector to detect and distinguish the adversarial examples. The detection algorithm was tested and verified on IRIS, MNIST, and stock time series datasets. The simulation experimental results show that the calculated LID values can highlight the difference between adversarial examples and normal examples, and can be used as a detection basis to differentiate example attributes. Theoretical research proves that the time complexity of the proposed detection algorithm is the same order of magnitude as the product of the number of iterations of Grover operator and the square root of the number of adjacent examples and the number of training examples, which is obviously better than that of the adversarial example detection algorithm based on LID and achieves exponential acceleration.